<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>修改采购价格单</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="../../../../elementUI/index.css">
  <link rel="stylesheet" href="../../../../css/index.css">
</head>

<body>
  <div id="app" class="minWidth">
    <el-form :model="form" :rules="rules" ref="contract" inline-message="true" style="width: 100%">
      <div class="table_titel">
        <div class="titel">修改采购价格单</div>
      </div>
      <el-descriptions :column="4" border size="small">
        <el-descriptions-item label="开始时间">
          <el-form-item prop="Start_Date">
            <el-date-picker v-model.trim="form.Start_Date" type="datetime" placeholder="请选择开始时间"
              value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="结算时间">
          <el-form-item prop="End_Date">
            <el-date-picker v-model.trim="form.End_Date" type="datetime" placeholder="请选择结算时间"
              value-format="yyyy-MM-dd HH:mm:ss"></el-date-picker>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="供应商流水号">
          <el-form-item prop="Supplier_SerialNumber">
            <el-select v-model.trim="form.Supplier_SerialNumber" placeholder="请选择供应商" filterable style="width: 100%">
              <el-option v-for="(item,index) in supplier_info" :key="index" :label="item.Supplier_Name"
                :value="item.Supplier_SerialNumber"></el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
      </el-descriptions>
      <div class="table_titel">
        <div class="titel">修改采购价格单明细</div>
        <div class="operation">
          <el-button type="primary" size="small" @click="add_purchase_unitprice_detail">新增</el-button>
          <el-button type="danger" size="small" @click="remove_purchase_unitprice_detail">删除</el-button>
        </div>
      </div>
      <el-descriptions :column="2" border size="small" v-for="(item,index) in form.Children.purchase_unitprice_detail"
        :key="index">
        <el-descriptions-item label="商品编号">
          <el-form-item :rules="Article_SerialNumber"
            :prop="'Children.purchase_unitprice_detail.' + index + '.Article_SerialNumber'">
            <el-select v-model.trim="item.Article_SerialNumber" placeholder="请选择商品" filterable
              @change="Change_Unit_Price(index,$event)" style="width: 100%">
              <el-option v-for="(item,index) in article_info" :key="index" :label="item.Article_Name"
                :value="item.Article_SerialNumber"></el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="商品规格">
          <el-form-item :rules="Article_Specifications_SerialNumber"
            :prop="'Children.purchase_unitprice_detail.' + index + '.Article_Specifications_SerialNumber'">
            <el-select :disabled="isDisabled" v-model.trim="item.Article_Specifications_SerialNumber"
              placeholder="请选择规格" filterable @change="Change_Specifications_Name(index)" style="width: 100%">
              <el-option v-for="(item,index) in item.specs" :key="item.Article_Specifications_SerialNumber"
                :label="item.Specifications_Name" :value="item.Article_Specifications_SerialNumber"></el-option>
            </el-select>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="零售价">
          <el-form-item  :prop="'Children.purchase_unitprice_detail.' + index + '.Unit_Price'">
            <el-input v-model.trim="item.Unit_Price" disabled placeholder="零售价"></el-input>
          </el-form-item>
        </el-descriptions-item>
        <el-descriptions-item label="采购单价">
          <el-form-item :rules="Purchase_Unit_Price"
            :prop="'Children.purchase_unitprice_detail.' + index + '.Purchase_Unit_Price'">
            <el-input v-model.trim="item.Purchase_Unit_Price" placeholder="请输入销售单价"></el-input>
          </el-form-item>
        </el-descriptions-item>
      </el-descriptions>
      <el-form-item class="form-operation">
        <el-button @click="window.history.back()">返回</el-button>
        <el-button type="primary" :loading="loading" @click="submitForm('contract')">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
  </div>
  <script type="text/javascript" src="../../../../js/jquery-3.6.0.min.js"></script>
  <script type="text/javascript" src="../../../../js/jquery.cookie.js"></script>
  <script type="text/javascript" src="../../../../js/vue.min.js"></script>
  <script type="text/javascript" src="../../../../elementUI/index.js"></script>
  <script type="text/javascript" src="../../../../js/utils.js"></script>
  <script type="text/javascript" src="../../../../js/ID_Validity.js"></script>
  <script type="text/javascript" src="./js/Edit.js"></script>
</body>

</html>